<?php

namespace App\Http\Requests\Admin;

use Illuminate\Foundation\Http\FormRequest;

class MenusRequest extends FormRequest
{

    /**
     *
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Determine if the user is authorized to make this request.
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required',
            'link'  => 'required',
            'key'  => 'required'
        ];
    }

    /**
     * @return array
     */
    public function messages()
    {
        return [
            'name.required' => '名称必填',
            'link.required' => '地址必填',
            'key.required' => '标示必填',
        ];
    }
}
